using System;
using System.Collections.Generic;
using System.Text;
using DTO;
using DAL;

namespace BUS
{
    public class CommentImage
    {
        public static void Insert(tbCommentimage commentimage)
        {
            CommentimageDAL commenimagedal = new CommentimageDAL();
            commenimagedal.Insert(commentimage);
        }
        public static void Update(tbCommentimage commentimage)
        {
            CommentimageDAL commenimagedal = new CommentimageDAL();
            commenimagedal.Update(commentimage);
        }
        public static void Delete(int iD)
        {
            CommentimageDAL commenimagedal = new CommentimageDAL();
            commenimagedal.Delete(iD);
        }
        public static tbCommentimagecollection GET(string Where, int PageIndex, int PageSize,
                                        string OrderBy, string OrderDirection,
                                        out int TotalRecords)
        {
            CommentimageDAL commenimagedal = new CommentimageDAL();
            return commenimagedal.GET(Where, PageIndex, PageSize,
                            OrderBy, OrderDirection, out TotalRecords);
        }
        public static tbCommentimage GetByID(int iD)
        {
            int t = 0;
            CommentimageDAL commenimagedal = new CommentimageDAL();
            tbCommentimagecollection Commentimagecollection = commenimagedal.GET("where " + tbCommentimagecolumn.idcommentimage.ToString() + " = " + iD.ToString(), 0, 0,
                tbCommentimagecolumn.idcommentimage.ToString(), "ASC", out t);
            if (Commentimagecollection.Count == 1)
                return Commentimagecollection[0];
            return null;
        }
        public static tbCommentimagecollection GetAll()
        {
            int t = 0;
            CommentimageDAL commentimagedal = new CommentimageDAL();
            return commentimagedal.GET("where 1=1", 0, 10,
                tbCommentimagecolumn.idcommentimage.ToString(), "ASC", out t);
        }
    }
}
